import router from "@/router";
import axios from "axios";
import { Message } from "element-ui";
import store from "@/store";

const service = axios.create({
    baseURL: "/api",
    // 超时
    timeout: 100000
})

//请求拦截器
service.interceptors.request.use(
    config => {
   config.headers['Authorization'] = localStorage.getItem("token");
        return config
    },
    error => {
        return Promise.reject(error);
    }
)
//响应请求拦截
service.interceptors.response.use(resp =>{
	return resp.data
},err =>{
	return Promise.reject(error);
}
)
export default service;